package objects;

import java.util.ArrayList;

import globals.FreeVector;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.geom.Circle;

public class Wall extends Collidable{
	Color selfColor;
	public Wall(int xin, int yin, int rin, Color me){
		super(xin, yin, rin, new FreeVector());
		selfColor=me;
	}
	public void update(ArrayList<Collidable> objects){
		super.update(objects);
	}
	public void draw(Graphics g){
		if(this.hasCollided){
			g.setColor(selfColor.addToCopy(Color.red));
			g.fill(new Circle(x,y,r));
			g.setColor(selfColor.addToCopy(Color.red).darker());
			g.draw(new Circle(x,y,r));
		}else{
			g.setColor(selfColor);
			g.fill(new Circle(x,y,r));
			g.setColor(selfColor.darker());
			g.draw(new Circle(x,y,r));
		}
	}
	public int getX(){return x;}
	public int getY(){return y;}
	public void collide(Collidable B){
		FreeVector vAdd=this.direction;
		vAdd.sub(B.direction);
		vAdd.setAngle((float)(vAdd.getAngle()+Math.PI));
		B.direction.add(vAdd);
	}
}
